<% content_for :title do %><%= current_project.name %>[通讯录]<% end %>


<table class="table table-bordered ">
<thead>
	<tr>
		<td>姓名</td>
		<td>邮箱</td>
		<td>联系电话</td>
</tr>
</thead>

<tr>
	<th colspan="3">》项目管理员</th>
</tr>
<% @project_admin_members.each do |member|%>
	<tr>
		<td><%= member.user.name %></td>
		<td>
			<a href="mailto: <%= member.user.email %>"><%= member.user.email %></a>
		</td>
		<td><%= member.user.phone %></td>
	</tr>	
<%end%>

<%@groups.each do |group|%>
<tr>
	<th colspan="3">》》<%= group.name %></th>
	<% group.display_members.each do |member|%>
	<tr>
		<td><%= member.user.name %> <%= "(管理员)" if member.is_group_admin %></td>
		<td>
		<a href="mailto: <%= member.user.email %>"><%= member.user.email %></a>
		</td>
		<td><%= member.user.phone %></td>
	</tr>	
<%end%>
</tr>
<%end%>


<% unless @system_admins.empty? %>
<tr>
	<th colspan="3" align="center">》系统管理员</th>
</tr>

<% @system_admins.each do |user|%>
	<tr>
		<td><%= user.name %></td>
		<td>
			<a href="mailto: <%= user.email %>"><%= user.email %></a>
		</td>
		<td><%= user.phone %></td>
	</tr>	
<%end%>

<%end%>


<% unless @not_group_members.empty? %>

<tr>
	<th colspan="3" align="center">不属于任何小组</th>
</tr>
<% @not_group_members.each do |member|%>
	<tr>
		<td><%= member.user.name %></td>
		<td>
			<a href="mailto: <%= member.user.email %>"><%= member.user.email %></a>
		</td>
		<td><%= member.user.phone %></td>
	</tr>	
<%end%>

<%end%>

</table>